/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.gob.pnp.actions;

import com.opensymphony.xwork2.*;
import java.sql.*;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.interceptor.ServletRequestAware;
import pe.gob.pnp.despachadores.*;

/**
 *
 * @author Home
 */
public class ListaAscensoPersonal extends ActionSupport implements ServletRequestAware {

    private static final long serialVersionUID = 1L;
    private List<AscensosPersonal> lstAscensos;
    private HttpServletRequest servletRequest;

    @Override
    public String execute() {
        try {
           
            String nperscodigo=servletRequest.getParameter("nperscodigo");
            setLstAscensos(AscensoPersonalDespachador.obtenerAscensos(Integer.parseInt(nperscodigo)));
        } catch (SQLException ex) {
            ex.printStackTrace();
            return ERROR;
        }
        return SUCCESS;
    }

    /**
     * @return the lstBeneficio
     */
    public List<AscensosPersonal> getLstAscensos() {
        return lstAscensos;
    }

    /**
     * @param lstBeneficio the lstBeneficio to set
     */
    public void setLstAscensos(List<AscensosPersonal> lstAscensos) {
        this.lstAscensos = lstAscensos;
    }

    public void setServletRequest(HttpServletRequest servletRequest) {
        this.servletRequest = servletRequest;
    }
}
